<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\Visitor
 *
 * @property int $id
 * @property string $visitorName 访客名称
 * @property string $telephone 电话
 * @property string $openId openId
 * @property string $url 图片地址
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property \Illuminate\Support\Carbon|null $deleted_at
 * @method static \Illuminate\Database\Eloquent\Builder|Visitor newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|Visitor newQuery()
 * @method static \Illuminate\Database\Query\Builder|Visitor onlyTrashed()
 * @method static \Illuminate\Database\Eloquent\Builder|Visitor query()
 * @method static \Illuminate\Database\Eloquent\Builder|Visitor whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Visitor whereDeletedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Visitor whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Visitor whereOpenId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Visitor whereReason($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Visitor whereTelephone($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Visitor whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Visitor whereUrl($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Visitor whereVisitorName($value)
 * @method static \Illuminate\Database\Query\Builder|Visitor withTrashed()
 * @method static \Illuminate\Database\Query\Builder|Visitor withoutTrashed()
 * @mixin \Eloquent
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\VisitorReservesLog[] $visitorReservesLog
 * @property-read int|null $visitor_reserves_log_count
 */
class Visitor extends Model
{
    use HasDateTimeFormatter;
    use SoftDeletes;
    use HasFactory;

    /**
     * 访客预约日志
     * @return HasMany
     */
    public function visitorReservesLog(): HasMany
    {
        return $this->hasMany(VisitorReservesLog::class);
    }

}
